#ifndef _LNSTACK_H_
#define _LNSTACK_H_
#include "declare.h"
#include <stdio.h>
#include <stdlib.h>

struct Node;

typedef struct Node *PNode;

struct Node {
    ELEMTYPE info;
    PNode link;
};

struct stStack {
    PNode top;
    SIZE_T length;
};

typedef struct stStack * PLStack;

PLStack createEmptyStack();
int push(PLStack pstack, ELEMTYPE x);
int pop(PLStack pstack);
int top(PLStack pstack, ELEMTYPE *x);
int isEmpty(PLStack pstack);
int isFull(PLStack pstack);
int length(PLStack pstack);
int empty(PLStack pstack);
int destroy(PLStack *pstack);
int print(PLStack pstack);
#endif

